
int main(int argc, char **argv)
{
  ros::init(argc, argv, "serial_uart_node");
  ros::NodeHandle serial_handle;

#if 1
    if (pthread_create(&uart_thread,NULL, pthread_uart_monitor,NULL)!=0) {
                printf("Create  pthread_uart_monitor error!\n");
                exit(1);
    }
    sleep(1);
#endif

  ros::Rate loop_rate(100);
  ros::Subscriber rev_com = serial_handle.subscribe("key_board/topic_command", 10, commandCallback);

  ros::Publisher pub_odom_data  = serial_handle.advertise<navigation_msgs::odom>
          ("serial/odom_data", 10);
  navigation_msgs::odom odom_message;

  while (serial_handle.ok())
  {

      if(sensor_massage_mark==1){

          odom_message.left_speed=Small_Car_Pulse.left_speed;
          odom_message.right_speed=Small_Car_Pulse.right_speed;
          odom_message.car_angle=Small_Car_Pulse.car_angle;
          odom_message.motor_pulse=Small_Car_Pulse.motor_pulse;
          odom_message.imu_yaw=Small_Car_Pulse.imu_yaw;
          pub_odom_data.publish(odom_message);
          sensor_massage_mark=0;
      }
      loop_rate.sleep();
      ros::spinOnce();
  }

  return 0;
}
